package com.spring.test.factory;

import java.util.Objects;

public class Car {
	private String brand;
	private double price;
	public String getBrand() {
		return brand;
	}
	public void setBrand(String brand) {
		this.brand = brand;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	@Override
	public String toString() {
		return "Car [brand=" + brand + ", price=" + price + "]";
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		Car car = (Car) o;
		return Double.compare(car.price, price) == 0 && brand.equals(car.brand);
	}

	@Override
	public int hashCode() {
		return Objects.hash(brand, price);
	}

	public Car(String brand, double price) {
		this.brand = brand;
		this.price = price;
	}
	public Car() {
		
	}
	
}
